﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.Text;
using WoChu.RfClient.Entity;

namespace WoChu.RfClient.Duty
{

    public class PickReplenishUIRule
    {
        private static PickReplenishUIRule _NewInstance = new PickReplenishUIRule();

        public static PickReplenishUIRule NewInstance
        {
            get
            {
                if (_NewInstance == null)
                {
                    _NewInstance = new PickReplenishUIRule();
                }

                return _NewInstance;
            }
        }

        public List<LocationGoodsInfo> GetPickCellNo()
        {
            try
            {
                List<LocationGoodsInfo> _result = WoChu.CF.BaseFrame.WebClient.WebGetHelper<IPickReplenish>.NewInstance.InvokeWebMethod<List<LocationGoodsInfo>>("GetPickCellNo", new object[] { });

                return _result;
            }
            catch (Exception ex)
            {
                WoChu.CF.BaseFrame.Util.MessageBoxEx.Show(ex);
            }
            return null;
        }

        public List<PickReplenishInfo> GetPickLocationGoods(string batchNo, DateTime rationDate)
        {
            try
            {
                List<PickReplenishInfo> _result = WoChu.CF.BaseFrame.WebClient.WebGetHelper<IPickReplenish>.NewInstance.InvokeWebMethod<List<PickReplenishInfo>>("GetPickLocationGoods", new object[] { batchNo, rationDate });

                return _result;
            }
            catch (Exception ex)
            {
                WoChu.CF.BaseFrame.Util.MessageBoxEx.Show(ex);
            }
            return null;
        }



        public OutPutParams<bool> UpdateReplenishStatus(string userID, List<PickReplenishInfo> lstPickReplenish)
        {
            try
            {
                OutPutParams<bool> _result = WoChu.CF.BaseFrame.WebClient.WebGetHelper<IPickReplenish>.NewInstance.InvokeWebMethod<List<PickReplenishInfo>, OutPutParams<bool>>("UpdateReplenishStatus", new object[] { userID }, lstPickReplenish);

                return _result;
            }
            catch (Exception ex)
            {
                WoChu.CF.BaseFrame.Util.MessageBoxEx.Show(ex);
            }
            return null;
        }
    }
}
